<%--
  Created by IntelliJ IDEA.
  User: jz
  Date: 2022/3/14
  Time: 22:33
  To change this template use File | Settings | File Templates.
--%>
<%@ page contentType="text/html;charset=UTF-8" language="java" %>
<html>
<head>
    <link rel="stylesheet" href="${pageContext.request.contextPath}/css/orderPage.css">
    <link rel="stylesheet" href="${pageContext.request.contextPath}/layui/css/layui.css">
    <link rel="shortcut icon" href="${pageContext.request.contextPath}/image/smallLogo.svg" type="image/x-icon">
    <script src="${pageContext.request.contextPath}/js/jquery-3.6.0.min.js"></script>
    <script src="${pageContext.request.contextPath}/layui/layui.js"></script>
    <title>Title</title>
</head>
<body>

<%--<jsp:include page="../common/head.jsp"/>--%>

<div class="payment-tips">
    <span class="tips-icon"></span>

    <span id="timer" style="color:#ef7942"></span>
    ，逾期订单将提交失败。
</div>
</div>


<div class="payment-info-box">
    <div class="payment-info">
        <div class="pay-sucess">
            <img src="../images/paySuccess.png">
            <span>订单提交成功！</span>

        </div>
        <div class="pay_help">
            取车时务必携带
            <span>本人信用卡，本人二代有效身份证，本人有效地方驾驶证正副本</span>
        </div>
    </div>
    <div class="payment_details">
        <span class="pay_order">订单编号:${myorder.myorderNumber}</span>
        <span class="pay_ment">支付方式:支付宝支付</span>
        <span class="pay_ment">订单总价:${myorder.myorderTotalPrice}</span>
        <link rel="stylesheet" href="orderPage.css">
    </div>

    <div class="pay_link">
        <form method="post" class="f1" action="${pageContext.request.contextPath}/alipay">
            <input type="hidden" name="orderId" value="${myorder.myorderId}">
            <input type="hidden"  name="carId" value="${myorder.carId}" >
            <input type="submit" value="继续支付" class="anniu" style="visibility:visible">
        </form>
        <a class="pay" href="${pageContext.request.contextPath}">返回首页</a>
        <a class="pay" href="${pageContext.request.contextPath}/ordermanage">查看订单</a>
    </div>
</div>

<script type="text/javascript">
    var oBox= document.getElementById('timer');
    var maxtime = 2 * 60;
    function CountDown() {
        if (maxtime >= 0) {
            minutes = Math.floor(maxtime / 60);
            seconds = Math.floor(maxtime % 60);
            msg = "距离结束还有" + minutes + "分" + seconds + "秒";
            oBox.innerHTML = msg;
            // if (maxtime == 1 * 60)alert("还剩1分钟");
            --maxtime;
        } else{
            clearInterval(timer);
            alert("订单支付超时");
            <%--window.location.href="${pageContext.request.contextPath}/order/gopay.jsp"--%>
            $(".anniu").attr("style","display:none;");
        }
    }


    // setTimeout(function () {
    //     document.getElementsByClassName(".anniu")[0].style.visibility = "visible";
    // }, 120000)

    timer = setInterval("CountDown()", 1000);
</script>
</body>
</html>
